コード例 #1
0
        //Start crafting with timer
        public void StartCrafting(CraftData data)
        {
            if (data != null && current_crafting == null)
            {
                current_crafting = data;
                craft_timer      = 0f;
                character.StopMove();

                if (AssetData.Get().action_progress != null && data.craft_duration > 0.1f)
                {
                    craft_progress = Instantiate(AssetData.Get().action_progress, transform);
                    craft_progress.GetComponent <ActionProgress>().duration = data.craft_duration;
                }

                if (data.craft_duration < 0.01f)
                {
                    CompleteCrafting();
                }
            }
        }
コード例 #2
0
        void Start()
        {
            GenerateAutomaticOutline();

            if ((TheGame.IsMobile() || PlayerControls.IsAnyGamePad()) && groups.Length > 0 && AssetData.Get().item_merge_fx != null)
            {
                if (fx_parent == null)
                {
                    fx_parent = new GameObject("FX");
                }

                GameObject fx = Instantiate(AssetData.Get().item_merge_fx, transform.position, AssetData.Get().item_merge_fx.transform.rotation);
                fx.GetComponent <ItemMergeFX>().target = this;
                fx.transform.SetParent(fx_parent.transform);
            }
        }