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; }
private void GetMoveScript() { if (characterGameObject != null) { moveScript = characterGameObject.GetComponent <MoveScript>(); if (moveScript != null) { moveScript.MovementMultiplicator = moveScript.DefaultMovementMultiplicator - slowDownPercentage; } else { Deactivate(); } } else { Deactivate(); } }