Beispiel #1
0
        void CreateRobotObject(out GameObject theRobot)
        {
            GameObject robot = new GameObject("Robot");
            MoveScript move  = robot.AddComponent <MoveScript>();

            move.Speed = 35f;

            CreateHeadObject(robot.transform);
            CreateBodyObject(robot.transform);
            CreateArmsObject(robot.transform);
            CreateLegsObject(robot.transform);

            theRobot = robot;
        }
Beispiel #2
0
 private void GetMoveScript()
 {
     if (characterGameObject != null)
     {
         moveScript = characterGameObject.GetComponent <MoveScript>();
         if (moveScript != null)
         {
             moveScript.MovementMultiplicator = moveScript.DefaultMovementMultiplicator - slowDownPercentage;
         }
         else
         {
             Deactivate();
         }
     }
     else
     {
         Deactivate();
     }
 }