Example #1
0
    void Awake()
    {
        platform = Application.platform;
        //drawArea = new Rect(0, 0, Screen.width - Screen.width / 3, Screen.height);
        drawArea = new Rect(0, 0, Screen.width, Screen.height);
        //Load pre-made gestures

        sound_handler = FindObjectOfType <SoundsFM> ();
        effets        = FindObjectOfType <EffectMagicFM> ();
        canvas        = GameObject.Find("Canvas");
        //loadGestures ();
        if (use_kinect == true)
        {
            img_left = new GameObject("left_hand");
            img_left.transform.parent     = canvas.transform;
            img_left.transform.localScale = new Vector3(-1, 1, 1);
            Image circle = img_left.AddComponent <Image> ();
            circle.sprite = open_hand;


            img_right = new GameObject("right_hand");
            img_right.transform.parent = canvas.transform;

            circle        = img_right.AddComponent <Image> ();
            circle.sprite = open_hand;
        }
    }
Example #2
0
    // Use this for initialization
    void Awake()
    {
        score_script        = FindObjectOfType <ScoreHandlerFM> ();
        effets              = FindObjectOfType <EffectMagicFM> ();
        animator_controller = GetComponent <Animator> ();
        pathfinder          = GetComponent <UnityEngine.AI.NavMeshAgent> ();
        currentState        = State.Chasing;
        target              = GameObject.Find("Player").transform;
        StartCoroutine(UpdatePath());

        myCollisionRadius     = GetComponent <CapsuleCollider> ().radius;
        targetCollisionRadius = target.GetComponent <CapsuleCollider> ().radius;


        manager = GameObject.FindObjectOfType <GesturesShapeManager> ();
        manager.onShapeRecognition += onRecognizeShape;

        array_sprites = new List <Sprite> ();
        array_images  = new List <Image> ();
        index_images  = new List <int> ();
    }