コード例 #1
0
    //Visualisation:
    public override void DrawGizmos(GizmoManager gizmoManager)
    {
        gizmoManager.SetColor(Colour);
        Vector3 pos3d = new Vector3(Position().x, Position().y, 0.0f);

        gizmoManager.DrawSolidSphere(pos3d, Radius, "CircleCopters");
    }
コード例 #2
0
 void Start()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     SetGestureDescriptionParts();
     SetDepthGizmoParts();
     SetRotationGizmoParts();
     HighlightStatesToStateDetection(0);
 }
コード例 #3
0
 public void DrawGizmos(GizmoManager gizmoManager)
 {
     gizmoManager.SetColor(Color.black);
     for (int i = 0; i < CornerPoints.Length; i++)
     {
         Vector2 to    = CornerPoints[(i + 1) % CornerPoints.Length];
         Vector2 from  = CornerPoints[(i) % CornerPoints.Length];
         Vector3 to3   = new Vector3(to.x, to.y, 0.0f);
         Vector3 from3 = new Vector3(from.x, from.y, 0.0f);
         gizmoManager.DrawLine(from3, to3, 0.1f, "Walls");
     }
 }
コード例 #4
0
ファイル: GizmoManager.cs プロジェクト: caolanb10/Connect_4
    void Start()
    {
        if (_instance == null)
        {
            _instance = this;
        }
        else
        {
            Destroy(this.gameObject);
        }

        Initialize();
    }
コード例 #5
0
    void Start()
    {
        if (_instance == null)
        {
            _instance = this;
        }
        else
        {
            Destroy(this.gameObject);
        }

        SetGestureDescriptionParts();
        HighlightStatesToStateDetection(0);
        InitializeFlagParts();
    }
コード例 #6
0
    void Start()
    {
        if (_instance == null)
        {
            _instance = this;
        }
        else
        {
            Destroy(this.gameObject);
        }

        SetGestureDescriptionParts();
        HighlightStatesToStateDetection(0);
        InitializeFlagParts();
        InitializeTriggerPool();
        ManomotionManager.OnManoMotionFrameProcessed += DisplayInformationAfterManoMotionProcessFrame;
    }
コード例 #7
0
ファイル: MeleeEnemy.cs プロジェクト: thanhlongvu/Legendary
    void Update()
    {
        //Debug
        GizmoManager.DrawLine(transform.position, transform.position + Vector3.down * distanceToSwitchLand);

        //Move action
        if ((state == EnemyState.MOVE) && canMove)
        {
            Move();
        }

        //Scan action
        if (ScanBarrier())
        {
            if (canSwitchLand)
            {
                //TODO: left or right
                var randDirect = Random.Range(0, 100) / 50;

                MoveAround((MoveAroundDirect)randDirect);
            }
            else
            {
                //Attack
                BaseAttack();
            }
        }
        else
        {
            if (state != EnemyState.MOVE && canMove)
            {
                state = EnemyState.MOVE;
            }
        }

        //check time attack cooldown
        if (timeAttack > 0)
        {
            timeAttack -= Time.deltaTime;
        }
    }
コード例 #8
0
 private void Awake()
 {
     Instance = this;
     Initialize();
 }
コード例 #9
0
 private void Start()
 {
     _gizmoManager = GetComponent <GizmoManager>();
 }
コード例 #10
0
        public void InitializeRuntimeComponents()
        {
            if (!manoVisualization)
            {
                try
                {
                    manoVisualization = GameObject.Find("ManoVisualization").GetComponent <ManoVisualization>();
                }
                catch (Exception ex)
                {
                    Debug.LogError("Cannot find the ManoVisualization");
                }
            }

            if (!gizmoManager)
            {
                try
                {
                    gizmoManager = GameObject.Find("GizmoCanvas").GetComponent <GizmoManager>();
                }
                catch (Exception ex)
                {
                    Debug.LogError("Cannot find the GizmoManager");
                }
            }
            if (!manoMotionCanvas)
            {
                try
                {
                    manoMotionCanvas = GameObject.Find("ManoMotionCanvas");
                }
                catch (Exception ex)
                {
                    Debug.Log("Cannot find the ManoMotion Canvas");
                }
            }
            if (!menuToggleButtonObject)
            {
                try
                {
                    menuToggleButtonObject = GameObject.Find("ToggleMenu");
                }
                catch (Exception ex)
                {
                    Debug.Log("Cannot find the Menu Toggle Button");
                }
            }
            if (!featuresMenu)
            {
                try
                {
                    featuresMenu = GameObject.Find("MainFeaturesMenu");
                }
                catch (Exception ex)
                {
                    Debug.Log("Cannot find the Main Features Object");
                }
            }

            runTimeObjects.Add(manoVisualization.gameObject);
            runTimeObjects.Add(gizmoManager.gameObject);
            runTimeObjects.Add(manoMotionCanvas);
            runTimeObjects.Add(menuToggleButtonObject);
            runTimeObjects.Add(featuresMenu);

            SaveDefalutFeaturesToDisplay();

            if (CategoryManager.Instance)
            {
                CategoryManager.Instance.SetupMenu(defaultFunctionality);
            }
            else
            {
                Debug.Log("Cant find Category Manager");
            }

            HideApplicationComponents();
        }
コード例 #11
0
 public abstract void DrawGizmos(GizmoManager gizmoManager);
コード例 #12
0
 public void DrawGizmos(GizmoManager gizmoManager)
 {
     gizmoManager.SetColor(Color.black);
     gizmoManager.DrawSolidSphere(new Vector3(3.0f, 3.0f, 0.0f), 2, "2");
 }
コード例 #13
0
 public void DrawText(GizmoManager gizmoManager)
 {
     gizmoManager.SetColor(Color.red);
     gizmoManager.DrawText("Text", new Vector3(3.0f, 3.0f, 0.0f), new Vector3(1, 1, 1), "InfoText");
 }