예제 #1
0
 // Start is called before the first frame update
 void Start()
 {
     //gm = GameObject.FindGameObjectsWithTag
     hpManager          = transform.GetComponent <HPmanager>();
     gm                 = FindObjectOfType <GameMaster>();
     transform.position = gm.ultimocheckpos;
 }
예제 #2
0
    private void Awake()
    {
        patrol   = transform.parent.GetComponent <SimplePatrol>();
        ddol     = GameObject.Find("Manager").GetComponent <DDOL>();
        player   = GameObject.Find("Player");
        rb2D     = transform.parent.gameObject;
        rb       = rb2D.GetComponent <Rigidbody2D>();
        playerHp = player.GetComponent <HPmanager>();
        source   = GetComponent <AudioSource>();


        enemy       = GetComponent <GameObject>();
        anim        = GetComponent <Animator>();
        constraints = GetComponent <ScaleConstraint>();

        foreach (GameObject obj in ddol._ddolObjects)
        {
            if (obj.name == rb2D.name)
            {
                Debug.Log("ovo");
                Destroy(rb2D);
            }
        }
    }