コード例 #1
0
ファイル: Crafting.cs プロジェクト: Arthurcentrale/Ecoworld3
 // Start is called before the first frame update
 void Start()
 {
     bFond = bFond.GetComponent <Button>();
     bFond.onClick.AddListener(UpdateFond);
     Count      = 1;
     inventaire = inventaire.GetComponent <Inventaire>();
     button     = GetComponent <Button>();
     button.onClick.AddListener(TaskOnClick);
     Inc = Inc.GetComponent <Button>();
     Dec = Dec.GetComponent <Button>();
     Inc.onClick.AddListener(Increment);
     Dec.onClick.AddListener(Decrement);
     text.text = Count.ToString() + " / " + maxCount(recettecraft).ToString();
 }
コード例 #2
0
    void MakeDecal(Vector3 D, Vector3 N)
    {
        GameObject Dec;

        if (N == Vector3.zero)
        {
            Dec = Instantiate(Decal, D, Quaternion.identity);
        }
        else
        {
            Dec = Instantiate(Decal, D, Quaternion.LookRotation(N, Vector3.up));
        }



        Vector3[] Pos = new Vector3[2];

        Pos[0] = FirePosition.transform.position;
        Pos[1] = D;

        Dec.GetComponent <LineRenderer>().SetPositions(Pos);
    }