コード例 #1
0
 public static void CreateNavigationArrow(string actiongroup, ArrowTypeEnum type)
 {
     foreach (GameObject ship in Mission.MissionRes.enemis)
     {
         if (!ship)
         {
             continue;
         }
         if (ship.GetComponent <Ship>().actiongroup == actiongroup)
         {
             ship.gameObject.GetComponent <AIship>().CreateArrow(type);
         }
     }
 }
コード例 #2
0
    public void CreateArrow(GameObject player, GameObject target, ArrowTypeEnum type)
    {
        GameObject _arrow = Instantiate(arrow).gameObject;

        _arrow.GetComponent <NavigationArrow>().player = playership.transform;
        _arrow.GetComponent <NavigationArrow>().target = target.transform;
        _arrow.transform.SetParent(this.transform);
        _arrow.transform.localPosition = Vector3.zero;
        _arrow.transform.localScale    = Vector3.one;

        if (type == ArrowTypeEnum.Enemy)
        {
            _arrow.GetComponent <Image>().color = Color.red;
        }
        if (type == ArrowTypeEnum.Ally)
        {
            _arrow.GetComponent <Image>().color = Color.blue;
        }
        if (type == ArrowTypeEnum.Event)
        {
            _arrow.GetComponent <Image>().color = Color.yellow;
        }
    }
コード例 #3
0
ファイル: SceneRes.cs プロジェクト: Ukrop4ik/ProjectSpace
 public void CreateUiArrow(GameObject target, ArrowTypeEnum type)
 {
     spaceUI.CreateArrow(playershiptransform.gameObject, target, type);
 }
コード例 #4
0
 public void CreateArrow(ArrowTypeEnum type)
 {
     sceneres.CreateUiArrow(this.gameObject, type);
 }
コード例 #5
0
 public static void CreateNavigationArrowToObj(string objectname, ArrowTypeEnum type)
 {
     UI.CreateArrow(playership.gameObject, GameObject.Find(objectname), type);
 }