Inheritance: MonoBehaviour
コード例 #1
0
 // Use this for initialization
 void Start()
 {
     theCharacterMotor = gameObject.GetComponent<CharacterMotor2> ();
     theCharacterJump = gameObject.GetComponent<CharacterJump2> ();
     theCharacterShot = gameObject.GetComponent<CharacterShot> ();
     theCharacterDrill = gameObject.GetComponent<CharacterDrill> ();
 }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     Input.multiTouchEnabled = true;
     characterMotorScript = objPlayer.GetComponent<CharacterMotor2>();
     characterJumpScript = objPlayer.GetComponent<CharacterJump2>();
     characterShotScript = objPlayer.GetComponent<CharacterShot>();
 }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     Motor = GetComponent<CharacterMotor2>();
     Shot = GetComponent<CharacterShot>();
     Life = GetComponent<CharacterHealth>();
     Damage = GetComponent<TakeDamage>();
 }
コード例 #4
0
    void Start()
    {
        theEnemyCharacterMotor = gameObject.GetComponent<CharacterMotor2> ();
        thePlayerCharacterMotor = GameObject.Find ("Player").GetComponent<CharacterMotor2> ();

        //Using "ThePlayerCharacterMotor" to find this to avoid having to search through everything again.
        thePlayerGrounded = thePlayerCharacterMotor.GetComponentInChildren<GroundCheck> ();
    }
コード例 #5
0
    void Start()
    {
        theCharacterMotor = gameObject.GetComponent<CharacterMotor2> ();

        // Start the enemy moving right
        theCharacterMotor.RightActivation ();

        turning = false;
    }
コード例 #6
0
 // Use this for initialization
 void Start()
 {
     theCharacterMotor = GetComponentInParent<CharacterMotor2> ();
     theCharacterAutoCrouchTop = GetComponentInChildren<CharacterAutoCrouchTop> ();
     theCharacterAutoCrouchBottom = GetComponentInChildren<CharacterAutoCrouchBottom> ();
     theAnimator = GetComponentInParent<CharacterMotor2>().theAnimator;
     playerCollider = GetComponentInParent<BoxCollider>();
     originalColliderSize = playerCollider.size;
     originalColliderCenter = playerCollider.center;
 }
コード例 #7
0
    void Start()
    {
        //This will get the Animator
        anim = gameObject.GetComponent<Animator>();

        //These will get the Scripts
        theCharacterMotorScript = gameObject.GetComponent<CharacterMotor2>();
        theEnemyChargeScript = gameObject.GetComponent<EnemyCharge>();
        theEnemyShootAIScript = gameObject.GetComponent<EnemyShootAI>();
        theEnemyShootingLRScript = gameObject.GetComponent<enemyShootingLR>();
        thePaceBetweenWallsScript = gameObject.GetComponent<PaceBetweenWalls>();
        theSingleShotEnemyScript = gameObject.GetComponent<singleShotEnemy>();
        theTurretScript = gameObject.GetComponent<turret>();
        theCharacterShotScript = gameObject.GetComponent<CharacterShot>();
    }
コード例 #8
0
    // Use this for initialization
    void Start()
    {
        Core = FindObjectOfType<Attractor>();
        radius = Vector3.Distance(rb.position, Core.GetComponent<Transform>().position);
        rb = GetComponent<Rigidbody>();
        theCharacterMotor = GetComponent<CharacterMotor2>();

        if (theCharacterMotor.movingRight==true)
        {
            rb.velocity = transform.TransformDirection(new Vector3(enemyShotVelocityX, 0, 0));
            shootingRight = true;
        }

        if (theCharacterMotor.movingLeft==true)
        {
            rb.velocity = transform.TransformDirection(new Vector3(-enemyShotVelocityX, 0, 0));
            shootingRight = false;
        }
    }
コード例 #9
0
 void Start()
 {
     theCharacterMotor = gameObject.GetComponent<CharacterMotor2> ();
 }
コード例 #10
0
 // Use this for initialization
 void Start()
 {
     Motor = GetComponent<CharacterMotor2>();
 }
コード例 #11
0
 // Use this for initialization
 void Start()
 {
     theGroundCheck = GetComponentInChildren<GroundCheck> ();
     theCharacterMotor = GetComponent<CharacterMotor2> ();
 }
コード例 #12
0
 // Use this for initialization
 void Start()
 {
     thePlayerMotor = GameObject.Find ("Player").GetComponent<CharacterMotor2> ();
 }
コード例 #13
0
ファイル: PlayerMove.cs プロジェクト: ianburnette/IslandFox
 //setup
 void Awake()
 {
     myCamFocus = GameObject.Find ("Camera Focus").transform;
     focusControls = myCamFocus.GetComponent<cameraFocusControls> ();
     camFocusLocation = myCamFocus.position;
     inventory = GetComponent<PlayerInventory> ();
     if (GetComponent<playerIslandGrow> () != null) {
         islandGrower = GetComponent<playerIslandGrow> ();
     }
     camChange = GetComponent<cameraChanger> ();
     anim = GetComponent<Animator> ();
     rb = GetComponent<Rigidbody> ();
     //create single floorcheck in centre of object, if none are assigned
     if(!floorChecks)
     {
         floorChecks = new GameObject().transform;
         floorChecks.name = "FloorChecks";
         floorChecks.parent = transform;
         floorChecks.position = transform.position;
         GameObject check = new GameObject();
         check.name = "Check1";
         check.transform.parent = floorChecks;
         check.transform.position = transform.position;
         Debug.LogWarning("No 'floorChecks' assigned to PlayerMove script, so a single floorcheck has been created", floorChecks);
     }
     //assign player tag if not already
     if(tag != "Player")
     {
         tag = "Player";
         Debug.LogWarning ("PlayerMove script assigned to object without the tag 'Player', tag has been assigned automatically", transform);
     }
     //usual setup
     mainCam = GameObject.FindGameObjectWithTag("MainCamera").transform;
     dealDamage = GetComponent<DealDamage>();
     characterMotor = GetComponent<CharacterMotor2>();
     //gets child objects of floorcheckers, and puts them in an array
     //later these are used to raycast downward and see if we are on the ground
     floorCheckers = new Transform[floorChecks.childCount];
     for (int i=0; i < floorCheckers.Length; i++)
         floorCheckers[i] = floorChecks.GetChild(i);
 }
コード例 #14
0
ファイル: Throwing.cs プロジェクト: ianburnette/IslandFox
    //setup
    void Awake()
    {
        //create grabBox is none has been assigned
        if(!grabBox)
        {
            grabBox = new GameObject();
            grabBox.AddComponent<BoxCollider>();
            grabBox.GetComponent<Collider>().isTrigger = true;
            grabBox.transform.parent = transform;
            grabBox.transform.localPosition = new Vector3(0f, 0f, 0.5f);
            Debug.LogWarning("No grabBox object assigned to 'Throwing' script, one has been created and assigned for you", grabBox);
        }

        playerMove = GetComponent<PlayerMove>();
        characterMotor = GetComponent<CharacterMotor2>();
        defRotateSpeed = playerMove.rotateSpeed;
        //set arms animation layer to animate with 1 weight (full override)
        if(animator)
            animator.SetLayerWeight(armsAnimationLayer, 1);
    }
コード例 #15
0
 void Start()
 {
     characterMotor = gameObject.GetComponent<CharacterMotor2>();
     characterJump = gameObject.GetComponent<CharacterJump2>();
     characterShot = gameObject.GetComponent<CharacterShot>();
 }
コード例 #16
0
 public void Start()
 {
     theCharacterMotor = gameObject.GetComponent<CharacterMotor2> ();
     Target = GameObject.Find ("Player").transform;
 }