コード例 #1
0
ファイル: Items.cs プロジェクト: Vasj0001/Game
	void Awake(){
		gameObject.name = gameObject.name.Replace("(Clone)", "");
		Player = GameObject.FindWithTag("Player").transform;
		hcs = Player.GetComponent<HeroControllerScript>();
		inv = Player.GetComponent<Inventory>();
		ItemObject = Resources.Load(gameObject.name) as GameObject;
	}
コード例 #2
0
ファイル: HeroHealth.cs プロジェクト: fromek/Pear1
    private HeroControllerScript playerControl; // Reference to the PlayerControl script.

    #endregion Fields

    #region Methods

    void Awake()
    {
        // Setting up references.
        playerControl = GetComponent<HeroControllerScript>();
        audioSource = GetComponent<AudioSource>();
    }
コード例 #3
0
ファイル: Gun.cs プロジェクト: fromek/Pear1
    private HeroControllerScript playerCtrl; // Reference to the PlayerControl script.

    #endregion Fields

    #region Methods

    void Awake()
    {
        // Setting up the references.
        anim = transform.root.gameObject.GetComponent<Animator>();
        playerCtrl = transform.root.GetComponent<HeroControllerScript>();
    }
コード例 #4
0
ファイル: Anim.cs プロジェクト: Vasj0001/Game
	// Use this for initialization
	void Start () {
		anim = GetComponent<Animator>();
		player = GameObject.FindGameObjectWithTag("Player");
		hcs = player.GetComponent<HeroControllerScript>();
		
	}
コード例 #5
0
ファイル: Info.cs プロジェクト: Vasj0001/Game
	void Start(){
		hcs = gameObject.GetComponent<HeroControllerScript>();
	}