Beispiel #1
0
        public override void AssignConstantIDs(bool saveScriptsToo, bool fromAssetFile)
        {
            if (isPlayer)
            {
                if (!fromAssetFile && GameObject.FindObjectOfType <Player>() != null)
                {
                    animChar = GameObject.FindObjectOfType <Player>();
                }

                if (animChar == null && AdvGame.GetReferences().settingsManager != null)
                {
                    animChar = AdvGame.GetReferences().settingsManager.GetDefaultPlayer();
                }
            }

            if (animChar != null)
            {
                ResetAnimationEngine(animChar.animationEngine, animChar.customAnimationClass);

                if (saveScriptsToo && editingAnimEngine && editingAnimEngine.RequiresRememberAnimator(this))
                {
                    editingAnimEngine.AddSaveScript(this, animChar.gameObject);
                }

                AssignConstantID <Char> (animChar, constantID, parameterID);
            }
        }
Beispiel #2
0
        override public void AssignConstantIDs(bool saveScriptsToo, bool fromAssetFile)
        {
            if (saveScriptsToo)
            {
                if (method == AnimMethod.BlendShape)
                {
                    if (isPlayer)
                    {
                        if (!fromAssetFile && GameObject.FindObjectOfType <Player>() != null)
                        {
                            Player player = GameObject.FindObjectOfType <Player>();
                            shapeObject = player.GetComponent <Shapeable>();
                        }

                        if (shapeObject == null && AdvGame.GetReferences().settingsManager)
                        {
                            Player player = AdvGame.GetReferences().settingsManager.GetDefaultPlayer();
                            if (player != null)
                            {
                                shapeObject = player.GetComponent <Shapeable>();
                            }
                        }
                    }

                    if (shapeObject != null)
                    {
                        AddSaveScript <RememberShapeable> (shapeObject);
                    }
                }

                ResetAnimationEngine();
                if (animEngine != null && animator != null && animEngine.RequiresRememberAnimator(this))
                {
                    animEngine.AddSaveScript(this, animator.gameObject);
                }
            }
        }