背包初始化 Backpack Initialization

  • Class:StarterPack

服务对象 Service Object
此对象为服务对象,可以使用GetService()函数获取此服务。Use GetService() to utilize this service.

不可创建 Cannot create
无法使用RWObject:New(Classname)创建此对象,也不在编辑器对象列表中显示。Cannot use RWObject:New(Classname) to create this object. It will not display in editor object list either.

Introduction

作用 Effects

背包初始化是决定玩家背包容量大小和进入游戏时玩家拥有的工具Tool的对象。
Pack Initialization determines player’s backpack space and initial objects of Tool.

创建和使用 Creation and Usage

背包初始化对象不能用RWObject:New(ClassName)函数创建。
Backpack initialization objects cannot be created by RWObject:New(ClassName).
背包初始化对象不能用Destroy()函数删除。
Backpack initialization objects cannot be destroyed by Destroy().
背包初始化对象不能用Clone()函数复制。
Backpack initialization objects cannot be duplicated by Clone().
玩家可以在背包初始化对象下创建工具,背包初始化对象下的工具会在游戏运行后自动放入玩家的装备栏和背包。
Player can create tools under Backpack Initialization objects, the tools will automatically be in player’s equipment and backpack once the game starts.

特性和注意事项 Features and Remarks

背包初始化对象中的属性只会在游戏运行时被调用一次。
Backpack initialization object’s property will only be called once when the game is running.
背包初始化对象中的工具会在玩家角色每次重生时重新放入玩家的装备栏和背包。
Backpack initialization object’s tools will reappear in player’s equipment and backpack everytime player regenerates.

属性 Functions

    BackpackCellCount        int   
    用来修改背包格子数量
    Changes amount of cells in backpack.

Inherited from RWObject

    Name        string   
    该对象的自定义名称
    The object’s customized name.

    ClassName        string   
    该对象对应的对象类型名称
    The object’s corresponding object class name.

    Parent        RWObject   
    该对象的父级对象
    The object’s parent object.

函数 Functions

Inherited from RWObject

    DelAllChild()
    删除所有子对象
    Delete all child objects.

    Available()
    检查对象是否可用
    Check if object is available to use.

    GetAncestorByName(Name)
    通过对象名字寻找父级对象
    Find ancestor by object’s name.

    GetAncestorByClassName(className)
    通过对象类型寻找父级对象
    Find ancestor by object’s class.

    GetChildByName(Name,recursive)
    通过对象名字寻找子级对象
    Find child by object’s name.

    GetChildByClassName(className,recursive)
    通过对象类型寻找子级对象
    Find child by object’s class.

    GetAllChild()
    寻找自身所有子级对象,并作为一个列表返回
    Find all child objects and return as a list.

    GetAllDescendant()
    递归寻找自身所有后代,并作为一个列表返回
    Recursively find all descendants of itself and return as a list.

    IsAncestor(TarObj)
    判断自身是否为目标对象的祖先
    Determine whether object itself is the ancestor of the target object.

    IsDescendant(TarObj)
    判断自身是否为目标对象的后代
    Determine whether object itself is the descendant of the target object.

    WaitForChild(childName,timeout)
    寻找自身的子对象。如果没有子对象,在没有填写timeout参数时,会暂停进程直到找到子对象;如果填写了timeout参数,会根据参数时间暂停进程,超出参数时间后,进程照常进行
    Find child of object. If child does not exist when there are no timeout parameters, the process will be paused until child is found. If there are timeout parameters, the process will pause based on the parameter, once process exceeds timeout parameters, the process will continue.

    Child(childName)
    根据给定的名字寻找自身的子对象
    Find object’s child based on name.

    Equals(TarObj)
    判断自身是否为目标对象,结果为真返回True,结果为假返回False;注意克隆、新建同类型、同名对象,equal结果均为假
    Determine whther object itself is target object, if true then will return as True, vice versa for false. Notice that duplicate, new same type, same name objects, and equals will return as false.

    IsClass(className)
    判断自身是否为给定的对象类型
    Determine whether object itself is the given object class.

事件 Events

Inherited from RWObject

    Destroyed()
    删除自身时触发
    Triggered when object destroyed itself.

    ChildAdded(childobject)
    添加子对象时触发
    Triggered when child object is added.

    ChildRemoved(childobject)
    移除子对象时触发
    Triggered when child object is removed

    DescendantAdded(descendantobject)
    添加后代时触发
    Triggered when descendant is added.

    DescendantRemoved(descendantobject)
    移除后代时触发
    Triggered when descendant is removed.

    AncestryChanged(AncestryChanged)
    祖先变更时触发
    Triggered when ancestry is changed.

文档更新时间: 2020-10-09 09:32   作者:刘征