コード例 #1
0
ファイル: Minigame.cs プロジェクト: dsesclei/DS501
    private GameObject[] pool_of_things = null; // misc.get_children_of(GameObject.Find("ThingsPool"));

    #endregion Fields

    #region Constructors

    //public Vector3 ScreenspacePointToGamePlane(Vector3 screenspace_position)
    //{
    //    return misc.ScreenspacePointToPlane(gamePlane, screenspace_position);
    //}
    // Things for the helper's internals
    public MinigameHelper( Minigame minigame, Interface inface, GameObject[] pool_of_things )
    {
        this.pool_of_things = pool_of_things;

        this.minigame = minigame;
        minigame.helper = this;
        minigame.init_text();
        name = minigame.name;
        instructions = minigame.instructions;

        this.inface = inface;
        inface.init();

        //gamePlane = new Plane( new Vector3( 0,0,1 ), 0.3f );

        // add more event monitoring
        onButton += () =>
        {
            Ray ray = Camera.main.ScreenPointToRay(inface.get_ScreenspacePosition());
            selected = misc.Raycast_Select_Object(ray);
            //Debug.Log("Raycast: " + selected);
            if (selected != null)
            {
                onSelect(selected);
            }
        };

        onMove += () =>
        {
            //Debug.Log("Drag? " + action_held + " : " + selected);
            if (selected != null && action_held)
            {
                onDrag(selected);
            }
        };
    }