Exemplo n.º 1
0
        private void Awake()
        {
            rigidbody = GetComponent <Rigidbody2D>();
            Assert.IsNotNull(rigidbody);

            facingComp = GetComponent <FacingHandler>();
            Assert.IsNotNull(facingComp);
        }
Exemplo n.º 2
0
    public void Spawn()
    {
        GameObject newObj = Instantiate(prefab, transform.position, prefab.transform.rotation, parent) as GameObject;

        if (passFacingToSpawnedObject)
        {
            FacingHandler newObjFacingHandler = newObj.GetComponent <FacingHandler>();

            if (newObjFacingHandler != null)
            {
                newObjFacingHandler.Facing = facingHandler.Facing;
            }
        }
    }
Exemplo n.º 3
0
 private void Awake()
 {
     facingComp = GetComponent <FacingHandler>();
     rb         = GetComponent <Rigidbody2D>();
 }