Exemplo n.º 1
0
        public void PlaceContainer(GameObject obj, Container containerType)
        {
            switch (containerType)
            {
            case Container.GrubJar:
                GrubJarUtility.MoveGrubJar(obj, x, y, elevation);
                break;

            case Container.GeoRock:
                GeoRockUtility.SetRockContext(obj, x, y, elevation);
                break;

            case Container.Chest:
                ChestUtility.MoveChest(obj, x, y, elevation);
                break;

            case Container.Tablet:
                obj.transform.position = new Vector3(x, y - elevation, 2.5f);
                obj.SetActive(true);
                break;

            case Container.Shiny:
            default:
                obj.transform.position = new Vector3(x, y, 0);
                obj.SetActive(true);
                break;
            }
        }
Exemplo n.º 2
0
        public override void OnEnableFsm(PlayMakerFSM fsm)
        {
            if (fsm.FsmName == "Geo Rock" && fsm.gameObject.name == GeoRockUtility.GetGeoRockName(this))
            {
                GeoRockUtility.ModifyGeoRock(fsm, location.flingType, this, items);
            }

            if (fsm.FsmName == "Shiny Control" && ShinyUtility.TryGetItemFromShinyName(fsm.gameObject.name, this, out var item))
            {
                ShinyUtility.ModifyShiny(fsm, location.flingType, this, item);
                if (!HasVisited() && location.flingType == FlingType.Everywhere)
                {
                    ShinyUtility.FlingShinyRandomly(fsm);
                }
                else
                {
                    ShinyUtility.FlingShinyDown(fsm);
                }
                fsm.gameObject.transform.Translate(new Vector3(0, 0, -0.1f));
            }

            if (fsm.FsmName == "Shiny Control" && ShinyUtility.GetShinyPrefix(this) == fsm.gameObject.name)
            {
                ShinyUtility.ModifyMultiShiny(fsm, location.flingType, this, items);
                if (!HasVisited() && location.flingType == FlingType.Everywhere)
                {
                    ShinyUtility.FlingShinyRandomly(fsm);
                }
                else
                {
                    ShinyUtility.FlingShinyDown(fsm);
                }
                fsm.gameObject.transform.Translate(new Vector3(0, 0, -0.1f));
            }

            if (fsm.FsmName == "Bottle Control" && fsm.gameObject.name == GrubJarUtility.GetGrubJarName(this))
            {
                GrubJarUtility.ModifyBottleFsm(fsm.gameObject, location.flingType, this, items);
            }

            if (fsm.FsmName == "Chest Control" && fsm.gameObject.name == ChestUtility.GetChestName(this))
            {
                ChestUtility.ModifyChest(fsm, location.flingType, this, items);
            }
        }
        public void PlaceContainer(GameObject obj, Container containerType)
        {
            GameObject target = FindGameObject();

            switch (containerType)
            {
            case Container.GrubJar:
                SetContext(obj, target);
                GrubJarUtility.AdjustGrubJarPosition(obj, elevation);
                break;

            case Container.GeoRock:
                GeoRockUtility.SetRockContext(obj, target, elevation);
                break;

            case Container.Chest:
            case Container.Shiny:
            default:
                SetContext(obj, target);
                break;
            }
        }