コード例 #1
0
ファイル: Coin.cs プロジェクト: fafase/Catharsis
    private void Start() 
    {
        float distance = Mathf.Abs(Camera.main.transform.position.z);
        var frustumHeight = distance * Mathf.Tan(Camera.main.fieldOfView * 0.5f * Mathf.Deg2Rad);
        var frustumWidth = -frustumHeight * Camera.main.aspect;

        translatePosition = new Vector3(frustumWidth, frustumHeight, 0f);
        randomStart = Random.Range(0.0f, Mathf.PI);
        startPosition = transform.position.y;
        GameObject cat = GameObject.FindGameObjectWithTag("Player");
		this.catController = cat.GetComponent<CatController> ();
    }
コード例 #2
0
    IEnumerator handleConfigureSession(WWW _www)
    {
        yield return _www;

        if (_www.text == "cat1")
        {
            currentCat = cat1;
            otherCat = cat2;
        }
        else
        {
            currentCat = cat2;
            otherCat = cat1;
        }

        SendPosition();
    }
コード例 #3
0
	// Use this for initialization
	void Start () {
		Debug.Log ("CatController Start");
		instance = this;
		lane = 0;

		canMoveLeft = true;
		canMoveRight = true;
		inDanzerZone = false;
		eatenPowerPellet = false;
		gettingPushed = false;

		/*
		middleSprite = transform.FindChild ("middleSprite").gameObject;
		leftSprite = transform.FindChild ("leftSprite").gameObject;
		rightSprite = transform.FindChild ("rightSprite").gameObject;
		*/
	}
コード例 #4
0
ファイル: CatUpdater.cs プロジェクト: houmie/ZombieCongaUnity
 // Use this for initialization
 void Start()
 {
     catController = transform.parent.GetComponent<CatController>();
 }
コード例 #5
0
ファイル: BasicAttack.cs プロジェクト: Lei-k/Unity
 void Awake()
 {
     controller = GetComponent<CatController>();
     move = GetComponent<Move>();
     anim = GetComponent<Animator>();
 }
コード例 #6
0
 private void death(CatController loserCat)
 {
     ParticleSystem death =  GameObject.Find("Death").GetComponent<ParticleSystem>();
     death.Play();
     death.transform.position = new Vector3(loserCat.transform.position.x, loserCat.transform.position.y, death.transform.position.z);
     
 }