示例#1
0
 public void AddNodeFeedForward(PassNode node)
 {
     if (nodesFeedForward.Contains(node) == false)
     {
         nodesFeedForward.Add(node);
     }
 }
示例#2
0
 public void AddNodeActivated(PassNode node)
 {
     if (nodesActivated.Contains(node) == false)
     {
         nodesActivated.Add(node);
     }
 }
示例#3
0
 public PassLink(PassNode nodeFrom0, PassNode nodeTo0, PassGlobal global0)
 {
     global   = global0;
     nodeFrom = nodeFrom0;
     nodeTo   = nodeTo0;
     CreateGo();
 }
示例#4
0
 public void UpdateNodesActivated()
 {
     for (int n = 0; n < nodesActivated.Count; n++)
     {
         PassNode node = nodesActivated[n];
         node.CreateLinks();
     }
 }
示例#5
0
 public void UpdateNodesFeedForward()
 {
     for (int n = 0; n < nodesFeedForward.Count; n++)
     {
         PassNode node = nodesFeedForward[n];
         node.FeedForward();
     }
 }
    void Awake()
    {
        //Pass and load data
        passNode        = GameObject.Find("PassNode").GetComponent <PassNode>();
        databaseHandler = GameObject.Find("Database").GetComponent <DatabaseHandler>();

        //Get other data
        loadGameWarningPanel = GameObject.Find("Interface/LoadGameWarningPanel");
        loadGameWarningPanel.SetActive(false);
        warningPanel = GameObject.Find("Interface/WarningContainer");
        warningPanel.SetActive(false);
        profileName = transform.Find("ProfileNameInputField").GetComponent <InputField>();
    }
示例#7
0
    public void FeedForward()
    {
        if (value > 0)
        {
            for (int n = 0; n < links.Count; n++)
            {
                PassNode node    = links[n].nodeTo;
                float    portion = value / links.Count;
                portion    = value * .85f;
                node.value = portion;
            }
        }
//		value = 0;
        UpdateValue(value);
    }
示例#8
0
    void Awake()
    {
        tutorialSet = transform.Find("TutorialSet").GetComponent <TutorialSet>();
        passNode    = GameObject.Find("PassNode").GetComponent <PassNode>();


        tutorialSetObject = transform.Find("TutorialSet").gameObject;
        tutorialSetObject.SetActive(false);

        firstTimePanel = GameObject.Find("FirstTimePanel");
        if (passNode.IsNewGame)
        {
            firstTimePanel.SetActive(true);
        }
        else
        {
            firstTimePanel.SetActive(false);
        }
    }
    void Start()
    {
        passNode = GameObject.Find("PassNode").GetComponent <PassNode>();

        //Get cameras
        introCam = GameObject.Find("Intro Camera").GetComponent <Camera>();
        mainCam  = GameObject.Find("Main Camera").GetComponent <Camera>();

        introVideo = GetComponent <VideoPlayer>();

        bgm = GameObject.Find("AudioObject/BGM").GetComponent <AudioSource>();

        if (passNode.IsNewGame)
        {
            PlayVideo();
        }
        else
        {
            mainCam.enabled  = true;
            introCam.enabled = false;
        }
    }
示例#10
0
    public PassGlobal()
    {
        nodes            = new List <PassNode>();
        nodesActivated   = new List <PassNode>();
        nodesFeedForward = new List <PassNode>();
        parentNodes      = new GameObject("parentNodes");
        parentLinks      = new GameObject("parentLinks");
        tmpGo            = new GameObject("tmpGo");
        //
        string style = "line";

        //
        if (style == "line")
        {
            for (float x = 0; x < sizeGrid; x++)
            {
                Vector3  pos  = RandomizeWithRange(new Vector3(x, x, 0), randomizeBy);
                PassNode node = new PassNode(pos, this);
            }
        }
        if (style == "image")
        {
            string    filename = "size28_a";          //_test";
            Texture2D texture  = Resources.Load <Texture2D>(filename);
            for (float x = 0; x < sizeGrid; x++)
            {
                for (float y = 0; y < sizeGrid; y++)
                {
                    Color    color = texture.GetPixel((int)x, (int)y);
                    float    z     = 3 * color.grayscale;
                    Vector3  pos   = new Vector3(x, z, y);
                    PassNode node  = new PassNode(pos, this);
                }
            }
        }
        if (style == "ball")
        {
            for (int n = 0; n < numNodes; n++)
            {
                float yaw   = Random.Range(0, 360f);
                float pitch = Random.Range(0, 360f);
                float roll  = 0;
                tmpGo.transform.position    = Vector3.zero;
                tmpGo.transform.eulerAngles = new Vector3(pitch, yaw, roll);
                tmpGo.transform.position   += tmpGo.transform.forward * radius;
                Vector3  pos  = tmpGo.transform.position;
                PassNode node = new PassNode(pos, this);
            }
        }
        if (style == "box")
        {
            for (float x = 0; x < sizeBox; x++)
            {
                for (float y = 0; y < sizeBox; y++)
                {
                    for (float z = 0; z < sizeBox; z++)
                    {
                        if ((x == 0 || x == sizeBox - 1) || (y == 0 || y == sizeBox - 1) || (z == 0 || z == sizeBox - 1))
                        {
                            Vector3  pos  = new Vector3(x, y, z);
                            PassNode node = new PassNode(pos, this);
                        }
                    }
                }
            }
        }
        if (style == "grid")
        {
            for (float x = 0; x < sizeGrid; x++)
            {
                for (float y = 0; y < sizeGrid; y++)
                {
                    for (float z = 0; z < sizeGrid; z++)
                    {
                        PassNode node = new PassNode(new Vector3(x, y, z), this);
                    }
                }
            }
        }
        if (style == "panel")
        {
            for (float x = 0; x < sizeGrid; x++)
            {
                for (float y = 0; y < sizeGrid; y++)
                {
                    Vector3  pos  = RandomizeWithRange(new Vector3(x, y, 0), randomizeBy);
                    PassNode node = new PassNode(pos, this);
                }
            }
        }
        if (style == "round")
        {
            for (int n = 0; n < numNodes; n++)
            {
                PassNode node = new PassNode(Random.insideUnitSphere * radius, this);
            }
        }
    }