Пример #1
0
    public override void DrawnNodeProperties(GUISkin skin)
    {
        base.DrawnNodeProperties(skin);

        FieldInspectorHelper.StartSection();
        collisionMask = FieldInspectorHelper.ShowMaskField("Collide Layer", collisionMask, skin);
        FieldInspectorHelper.ShowFlexibleFloatField("Col. Time Gap", fl_collisionGap, skin);
        killOnCollision = FieldInspectorHelper.ShowBoolField("Destroy On Hit", killOnCollision, skin);
        FieldInspectorHelper.EndSection();

        FieldInspectorHelper.ShowTitle("Spawn GameObject On Collision", skin, true);
        FieldInspectorHelper.StartSection();
        int spawnGameObjectListCount = FieldInspectorHelper.ShowIntField("Spawn Count", spawnGameObjectList.Count, skin);

        if (spawnGameObjectList.Count != spawnGameObjectListCount)
        {
            spawnGameObjectList.Resize <SpawnGameObjectTrigger>(spawnGameObjectListCount);
        }
        for (int i = 0; i < spawnGameObjectList.Count; i++)
        {
            var spawnTrigger = spawnGameObjectList[i];
            if (spawnTrigger == null)
            {
                spawnTrigger           = new SpawnGameObjectTrigger();
                spawnGameObjectList[i] = spawnTrigger;
            }

            spawnTrigger.bShow = FieldInspectorHelper.ShowExpandField(string.Format("Index {0}", i + 1), spawnTrigger.bShow, skin);
            if (spawnTrigger.bShow)
            {
                FieldInspectorHelper.StartSubSection();
                spawnTrigger.template    = FieldInspectorHelper.ShowObjectField <GameObject>("Template", spawnTrigger.template, skin);
                spawnTrigger.count       = FieldInspectorHelper.ShowIntField("Quanity", spawnTrigger.count, skin);
                spawnTrigger.useLocation = FieldInspectorHelper.ShowBoolField("Copy Location", spawnTrigger.useLocation, skin);
                spawnTrigger.useRotation = FieldInspectorHelper.ShowBoolField("Copy Rotation", spawnTrigger.useRotation, skin);
                spawnTrigger.parentTo    = (ParentTo)FieldInspectorHelper.ShowEnumField("Parent To", spawnTrigger.parentTo, skin);
                FieldInspectorHelper.EndSubSection();
            }
        }
        FieldInspectorHelper.EndSection();
    }
Пример #2
0
    public override void DrawnNodeProperties(GUISkin skin)
    {
        base.DrawnNodeProperties(skin);

        FieldInspectorHelper.StartSection();

        int spawnGameObjectListCount = FieldInspectorHelper.ShowIntField("Spawn Count", spawnGameObjectList.Count, skin);

        if (spawnGameObjectList.Count != spawnGameObjectListCount)
        {
            spawnGameObjectList.Resize <SpawnGameObjectTrigger>(spawnGameObjectListCount);
        }

        for (int i = 0; i < spawnGameObjectList.Count; i++)
        {
            var spawnTrigger = spawnGameObjectList[i];
            if (spawnTrigger == null)
            {
                spawnTrigger           = new SpawnGameObjectTrigger();
                spawnGameObjectList[i] = spawnTrigger;
            }

            spawnTrigger.bShow = FieldInspectorHelper.ShowExpandField(string.Format("Index {0}", i + 1), spawnTrigger.bShow, skin);
            if (spawnTrigger.bShow)
            {
                FieldInspectorHelper.StartSubSection();
                spawnTrigger.template    = FieldInspectorHelper.ShowObjectField <GameObject>("Template", spawnTrigger.template, skin);
                spawnTrigger.count       = FieldInspectorHelper.ShowIntField("Quanity", spawnTrigger.count, skin);
                spawnTrigger.useLocation = FieldInspectorHelper.ShowBoolField("Copy Location", spawnTrigger.useLocation, skin);
                spawnTrigger.useRotation = FieldInspectorHelper.ShowBoolField("Copy Rotation", spawnTrigger.useRotation, skin);
                spawnTrigger.parentTo    = (ParentTo)FieldInspectorHelper.ShowEnumField("Parent To", spawnTrigger.parentTo, skin);
                FieldInspectorHelper.EndSubSection();
            }
        }
        FieldInspectorHelper.EndSection();
    }