FoxCompanion.SnowFoxTeleportFoxMain.TeleportFoxToTarget C# (CSharp) Méthode

TeleportFoxToTarget() public static méthode

public static TeleportFoxToTarget ( Transform target ) : void
target Transform
Résultat void
        public static void TeleportFoxToTarget(Transform target)
        {
            //FoxVars.foxShouldFollowPlayer = false;
            //FoxVars.foxShouldFollowSomething = false;

            //FoxVars.fox.transform.position = new Vector3(target.position.x, target.position.y + 0.3f, target.position.z);
            FoxVars.fox.transform.position = new Vector3(target.position.x + 0.99f, target.position.y, target.position.z);
            FoxVars.fox.transform.rotation = target.rotation;
            //FoxVars.mitt.transform.position = new Vector3(target.position.x, target.position.y, target.position.z);



            //MelonLogger.Log("Tepelort Pos [" + FoxVars.fox.transform.position.x + "][" + FoxVars.fox.transform.position.y + "][" + FoxVars.fox.transform.position.z + "]");
            MelonLogger.Log("Teleport fox to Player");
        }
    }

Usage Example

Exemple #1
0
        public override void OnUpdate()
        {
            // One time teleport to player
            if (FoxVars.timeToSpawnStarted == true)
            {
                if (FoxVars.foxSpawnTimer > 0)
                {
                    FoxVars.foxSpawnTimer -= Time.deltaTime;
                }
                else
                {
                    FoxVars.foxSpawnTimer      = FoxVars.timeToSpawn;
                    FoxVars.timeToSpawnStarted = false;

                    //if(PlayerManager.m_TeleportPending() == false)
                    SnowFoxTeleportFoxMain.TeleportFoxToTarget(GameManager.GetPlayerTransform());
                    SnowFoxPawprintsMain.initPaws();
                }
            }

            // Do ALL THE STUFF
            if (FoxVars.foxactive == true && FoxVars.foxSpawned == true && FoxVars.fox != null)
            {
                //MelonLogger.Log("doing something?");
                FoxVars.idleRand = UnityEngine.Random.Range(1, 5); // make some randoms for changing through idle animations


                //FoxVars.randomTarget.position = new Vector3(FoxVars.foxTransform.position.x + FoxVars.randomTarget.position.x + UnityEngine.Random.insideUnitCircle.x * 3, FoxVars.foxTransform.position.y + FoxVars.randomTarget.position.y + UnityEngine.Random.insideUnitCircle.y * 3, 0);

                // Update player, target and fox transforms
                FoxVars.playerTransform = GameManager.GetPlayerTransform();
                FoxVars.foxTransform    = FoxVars.fox.transform;

                SnowFoxInputsMain.SnowFoxInputsUpdate();
                SnowFoxManageMovementMain.SnowFoxManageMovement();
                SnowFoxAuroraMain.SnowFoxAurora();
                SnowFoxTargetingMain.SnowFoxTargeting();

                SnowFoxPawprintsMain.leavePaw(FoxVars.foxFLHandTrack.position, true, true);
                SnowFoxPawprintsMain.leavePaw(FoxVars.foxFRHandTrack.position, true, false);
                SnowFoxPawprintsMain.leavePaw(FoxVars.foxRLHandTrack.position, false, true);
                SnowFoxPawprintsMain.leavePaw(FoxVars.foxRRHandTrack.position, false, false);
            }
        }
All Usage Examples Of FoxCompanion.SnowFoxTeleportFoxMain::TeleportFoxToTarget
SnowFoxTeleportFoxMain