Exemplo n.º 1
0
    public virtual void DeathBehavior(Pawn killer)
    {
        if (killer)
        {
            //Debug.Log("Ye killed me, " + killer.name);
        }

        _controller.ProcessTree = false;

        if (moveScript)
        {
            moveScript.enabled = false;
        }
        Rigidbody rb = GetComponent <Rigidbody>();

        if (rb)
        {
            rb.freezeRotation = false;
        }
        DamageReciever dr = GetComponent <DamageReciever>();

        if (dr)
        {
            dr.enabled = false;
        }
        LookAtTarget ls = GetComponent <LookAtTarget>();

        if (ls)
        {
            ls.enabled = false;
        }

        Destroy(gameObject, 3.0f);
    }
Exemplo n.º 2
0
    void StartLevel()
    {
        if (ScoreTextObj != null)
        {
            scoreInstance = Instantiate(ScoreTextObj);
            scoreText     = scoreInstance.GetComponent <TextMesh>();
            scoreInstance.transform.position = GoalObj.transform.position + new Vector3(0.0f, 0.7f, 0.0f);
        }
        else
        {
            Debug.LogError("No Score Text Object defined in GameManager!!");
        }
        if (ArrowObj != null)
        {
            arrowInstance      = Instantiate(ArrowObj);
            arrowLookat        = arrowInstance.GetComponent <LookAtTarget>();
            arrowLookat.target = spawnerInstance;
            arrowInstance.transform.position = Vector3.Lerp(GoalObj.transform.position, Camera.main.transform.position + 2.0f * Camera.main.transform.forward, 0.8f);
            Destroy(arrowInstance, 5.0f);
        }
        else
        {
            Debug.LogError("No Score Text Object defined in GameManager!!");
        }

        GateTextObj.SetActive(false);
    }
 public void RecordAdditionalObjects()
 {
     if (LookAtTarget != null)
     {
         lookAtTargetPath = LookAtTarget.GetFullHierarchyPath();
     }
 }
Exemplo n.º 4
0
    public override void OnStartLocalPlayer()
    {
        base.OnStartLocalPlayer();

        lookAtTarget = Camera.main.GetComponent <LookAtTarget>();
        lookAtTarget.SetTarget(transform);

        numSwingsText = GameObject.FindGameObjectWithTag("NumSwingsText").GetComponent <Text>();
    }
Exemplo n.º 5
0
    public override void Initialize(Effect parentEffect, LayerMask mask, float life = 0, float damage = 0)
    {
        base.Initialize(parentEffect, mask, life, damage);

        lookScript = GetComponent <LookAtTarget>();
        //lookScript.Initialize(this);

        //StartCoroutine(Tracking());
    }
    public override void OnInspectorGUI()
    {
        baseClass = (LookAtTarget)target;

        drawCurrent();

        GUILayout.Space(20);

        base.OnInspectorGUI();
    }
Exemplo n.º 7
0
    private void Awake()
    {
        awareness = GetComponent <CircleCollider2D>();

        Transform go = transform.Find("LeftEye/Pupil");

        Assert.IsNotNull(go, "Failed to locate child \"LeftEye/Pupil\".");
        leftEye = go.GetComponent <LookAtTarget>();
        Assert.IsNotNull(leftEye, "Failed to locate LookAtMouse component.");

        go = transform.Find("RightEye/Pupil");
        Assert.IsNotNull(go, "Failed to locate child \"RightEye/Pupil\".");
        rightEye = go.GetComponent <LookAtTarget>();
        Assert.IsNotNull(rightEye, "Failed to locate LookAtMouse component.");

        go = transform.Find("Mouth");
        Assert.IsNotNull(go, "Failed to locate child \"Mouth\".");
        mouth = go.GetComponent <SpriteRenderer>();
        Assert.IsNotNull(mouth, "Failed to locate SpriteRenderer Mouth component.");
    }
Exemplo n.º 8
0
    private void Awake()
    {
        awareness = GetComponent <CircleCollider2D>();

        Transform go = transform.Find("LeftEye/Pupil"); //Looking in the star object parent for the pupil child.

        Assert.IsNotNull(go, "Failed to locate child\"LeftEye/Pupil\".");
        leftEye = go.GetComponent <LookAtTarget>();
        Assert.IsNotNull(leftEye, "Failed to locate look at mouse component.");

        go = transform.Find("RightEye/Pupil");
        Assert.IsNotNull(go, "Failed to locate child\"RightEye/Pupil\".");
        rightEye = go.GetComponent <LookAtTarget>();
        Assert.IsNotNull(rightEye, "Failed to locate look at mouse component.");

        go = transform.Find("Mouth");
        Assert.IsNotNull(go, "Failed to locate child\"Mouth\".");
        mouth = go.GetComponent <SpriteRenderer>();
        Assert.IsNotNull(mouth, "Failed to locate spriterenderer component on mouth.");
    }
        void Awake()
        {
            m_gObj         = gameObject;
            m_position     = m_gObj.transform.position;
            m_lookAtTarget = GetComponent <LookAtTarget>();
            m_InputField.onEndEdit.AddListener(EditingEnded);

            Material m = null;

            for (int i = 0; i < m_FrameMesh.childCount; i++)
            {
                var mr = m_FrameMesh.GetChild(i).GetComponent <MeshRenderer>();
                if (i == 0)
                {
                    m = new Material(mr.material);
                }
                mr.material = m;
                m_frameMeshes.Add(mr);
            }
        }
Exemplo n.º 10
0
    public void Init()
    {
        controller   = GetComponent <Boss3_Controller>();
        laserManager = GetComponent <LaserManager>();
        lookAtTarget = GetComponentInChildren <LookAtTarget>();
        animator     = GetComponent <Animator>();
        audioManager = controller.audioManager;
        player       = controller.player;

        lookAtTarget.target = player.transform;

        stLaser = new StandardLaser(laserRef);

        SetSpreadShotSubtraction(spreadShotSubtraction);

        //actionList.Add("Idle");
        actionList.Add("ShootPlayer");
        //actionList.Add("Retaliate");
        actionList.Add("RockLaserAttack");
        actionList.Add("DesperationAttack");
    }
Exemplo n.º 11
0
    private void Awake()
    {
        awarness = GetComponent <CircleCollider2D>();

        Transform go = transform.Find("LeftEye/Pupil");

        Assert.IsNotNull(go, "Failed to locate child \"LeftEye/Pupil\".");
        //Assert.IsNotNull(go, @"\"); @-sign = you will type out one backslash otherwise you need to have two backslashes
        leftEye = go.GetComponent <LookAtTarget>();
        Assert.IsNotNull(leftEye, "Failed to locate Look at mouse component");

        go = transform.Find("RightEye/Pupil");
        Assert.IsNotNull(go, "Failed to locate child \"RightEye/Pupil\".");
        //Assert.IsNotNull(go, @"\"); @-sign = you will type out one backslash otherwise you need to have two backslashes
        rightEye = go.GetComponent <LookAtTarget>();
        Assert.IsNotNull(rightEye, "Failed to locate Look at mouse component");

        go = transform.Find("Mouth");
        Assert.IsNotNull(go, "Failed to locate child \"Mouth\".");
        //Assert.IsNotNull(go, @"\"); @-sign = you will type out one backslash otherwise you need to have two backslashes
        mouth = go.GetComponent <SpriteRenderer>();
        Assert.IsNotNull(mouth, "Failed to locate SpriteRenderer component on mouth");
    }
Exemplo n.º 12
0
 // Use this for initialization
 protected virtual void Start()
 {
     targetFacer = GetComponent <LookAtTarget> ();
 }
Exemplo n.º 13
0
 public void SwitchToTarget(LookAtTarget target)
 {
     lookAtTarget = target;
 }
Exemplo n.º 14
0
    //Properties

    #region Unity Methods
    void Awake()
    {
        ship          = transform.parent.GetComponent <Ship>();
        lookAtTarget  = transform.parent.GetComponent <LookAtTarget>();
        defaultTarget = lookAtTarget.Target;
    }